const event = require('events')

const myevent = new event();

const fun =  () => {
    console.log('捕获到了事件---why');
}

myevent.on('why',fun)

myevent.emit('why');

myevent.off('why',fun);

myevent.on('wgy', () => {
    console.log('再次捕获到事件why');
})